package com.anyext.storage.group.impl;

import javax.sql.DataSource;

import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy;

import com.anyext.storage.group.GroupDescriptor;
import com.anyext.storage.policy.DataSourceType;

public class GroupDescriptorImpl implements GroupDescriptor {
	
	private String identity;
	
	private DataSource dataSource;
	
	private DataSourceType dataSourceType;
	
	private int lbfactor;

	@Override
	public String getIdentity() {
		return identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	@Override
	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = new LazyConnectionDataSourceProxy(dataSource);
	}

	@Override
	public DataSourceType getDataSourceType() {
		return dataSourceType;
	}

	public void setDataSourceType(DataSourceType dataSourceType) {
		this.dataSourceType = dataSourceType;
	}

	@Override
	public int getLbfactor() {
		return lbfactor;
	}

	public void setLbfactor(int lbfactor) {
		this.lbfactor = lbfactor;
	}

}
